home *** CD-ROM | disk | FTP | other *** search
/ Softwarová Záchrana 3 / Softwarova-zachrana-3.bin / Xteq X-Setup / xqdcXSP-Setup-EN.exe / {app} / plugins / XQ WinNT Drive Tools.xpl < prev    next >
Text File  |  2003-07-28  |  3KB  |  97 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 6.0"
  2. "TYPE"="3"
  3. "COUNT"="4"
  4. "UIPATH"="Appearance\Files&Folders\Drives"
  5. "NAME"="Drive Tools Menu"
  6. "OSVERSION"="0101011"
  7. "VERSION"="1.00"
  8. "LANGUAGE"="VBScript"
  9. "TEXT 1"="Check Disk"
  10. "DATA 1"="Applications|*.exe" 
  11. "TEXT 2"="Defrag"
  12. "DATA 2"="Applications|*.exe" 
  13. "TEXT 3"="Backup"
  14. "DATA 3"="Applications|*.exe" 
  15. "TEXT 4"="Clean Up"
  16. "DATA 4"="Applications|*.exe" 
  17. "DESCRIPTION 1"="When you right a drive inside the Explorer, select "Properties" and switch to the "Tools" tab, Windows will display several command you can execute on the current drive."
  18. "DESCRIPTION 2"="The programs that should be launched when you click on a button can be configured here. For example, you might not want to launch the default "Windows Backup" when you click the "Backup" button but Veritas BackupExec instead."
  19. "DESCRIPTION 3"="To insert the current drive into the command, type "%c". For example, "c:\backup.exe %c" will be expanded to "c:\backup.exe E:\" if executed on drive E:\".
  20. "DESCRIPTION 4"="The restore any of these command to their default values, simply clear the field and hit "Apply". "
  21. "AUTHOR"="Xteq Systems"
  22. "CONTACTURL"="http://www.xteq.com"
  23. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  24. "COMMENT 1"=" "
  25.  
  26.  
  27. sP="HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\"
  28. sV1="ChkDskPath"
  29. sV2="DefragPath"
  30. sV3="BackupPath"
  31. sV4="CleanupPath"
  32.  
  33. sDef="\@"
  34. sBackup="\XSET BAK"
  35.  
  36. Sub Plugin_Initialize
  37.  s=RegReadValue(sP & sV1 & sDef)
  38.  SetUIElement 1,s
  39.  
  40.  s=RegReadValue(sP & sV2 & sDef)
  41.  SetUIElement 2,s
  42.  
  43.  s=RegReadValue(sP & sV3 & sDef)
  44.  SetUIElement 3,s
  45.  
  46.  s=RegReadValue(sP & sV4 & sDef)
  47.  SetUIElement 4,s
  48. End Sub
  49.  
  50. Sub Plugin_CheckData(ElementIndex)
  51. End Sub
  52.  
  53. Sub Plugin_Apply(ElementIndex,ElementSubIndex)
  54.  Call DoChange(sP & sV1,GetUIElement(1),1)
  55.  Call DoChange(sP & sV2,GetUIElement(2),2)
  56.  Call DoChange(sP & sV3,GetUIElement(3),3)
  57.  Call DoChange(sP & sV4,GetUIElement(4),4)
  58. End Sub
  59.  
  60. Sub DoChange(DA_PATH,DA_NEW_VALUE,INDEX)
  61.  sBak=RegReadValue(DA_PATH & sBackup)
  62.  sCur=RegReadValue(DA_PATH & sDef)
  63.  
  64.  if Len(DA_NEW_VALUE)=0 then
  65.     'either restore or the field is really empty...
  66.     if Len(sBAK)>0 then 
  67.        Call RegWriteValue(DA_PATH & sDef,sBak,4)
  68.  
  69.        if RegValueExists(DA_PATH & sBackup) then
  70.           Call RegDeleteValue(DA_PATH & sBackup)
  71.        end if
  72.  
  73.        Call SetUIElement(INDEX,sBak)
  74.     else 
  75.        'there is no backup so write the empty value to the registry...
  76.        Call RegWriteValue(DA_PATH & sDef,"",4)   
  77.        Call SetUIElement(INDEX,"")
  78.     end if
  79.  else
  80.     'set the value...
  81.     if Len(sBAK)=0 then
  82.        'no backup so far, create one
  83.        if len(sCur)>0 then
  84.           Call RegWriteValue(DA_PATH & sBackup,sCur,4)
  85.        end if
  86.     end if
  87.  
  88.     Call RegWriteValue(DA_PATH & sDef,DA_NEW_VALUE,4)
  89.     Call SetUIElement(INDEX,DA_NEW_VALUE)
  90.  end if
  91.        
  92. ' if RegValueExists(DA_PATH & sBackup)
  93. End Sub
  94.  
  95. Sub Plugin_Terminate 
  96. End Sub
  97.